package com.party.admin.task;

import com.party.admin.biz.warn.WarnTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 预警定时任务
 * Created by wei.li
 *
 * @date 2017/8/4 0004
 * @time 11:05
 */

@Component(value = "quartzWarn")
public class QuartzWarn {

    @Resource(name = "smsWarnService")
    private WarnTemplate smsWarnService;

    protected static Logger logger = LoggerFactory.getLogger(QuartzWarn.class);

    public void run(){
        logger.info("预警定时任务启动");
        try {
            smsWarnService.warn();
        } catch (Exception e) {
            logger.error("预警定时任务异常", e);
        }
    }
}
